package com.guoxin.thread.join;

public class JoinThread {
    public static void main(String[] args) throws InterruptedException {

        Thread t1 = new Thread(() -> {
            for(int i=0;i<1000;i++){
                System.out.println(Thread.currentThread().getName()+"--"+i);
            }
        });

        Thread t2 = new Thread(() -> {
            for(int i=0;i<1000;i++){
                System.out.println(Thread.currentThread().getName()+"--"+i);
            }
        });

        Thread t3 = new Thread(() -> {
            for(int i=0;i<1000;i++){
                System.out.println(Thread.currentThread().getName()+"--"+i);
            }
        });
        t1.start();
        t1.join();
        t2.start();
        t2.join();
        t3.start();
    }
}
